home *** CD-ROM | disk | FTP | other *** search
- import java.awt.*;
- import java.awt.image.*;
- import java.applet.Applet;
-
- public class Letters extends Applet {
- // This applet demonstrates a "continue" statement
-
- char key;
- int keyNumber = (int)'A';
- int row = 0;
- int column = 5;
- int space = 20;
- int lines = 0;
-
- public void init () {
- setFont(new Font("TimesRoman", Font.BOLD,12));
- }
-
- public void paint (Graphics g) {
-
-
- Loop: for (int i = 0; i < 255; i++){ // Loop is a statement label
- key = (char)i;
-
- // If the character is not a letter or a digit, return to the loop
- if(!Character.isDigit(key) &&!Character.isLowerCase(key) && !Character.isUpperCase(key) )
- continue Loop; // continue with a statment label
-
- row++;
- lines++;
- if (lines == 25){
- lines = 0;
- column = column + 60;
- row = 0;
- }
-
- g.drawString (String.valueOf(key + " = "), column, 12*row);
- g.drawString (Integer.toString(keyNumber), column + space, 12*row);
- keyNumber++;
- }
-
- }
-
-
- }
-
-
-